﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace WcfContrib.Extensions.OutputControllers
{
    class FileOutputController : OutputControllerBase
    {
        #region IOutputController Members
        protected override void OnLoadState()
        {
        }

        protected override void OnOutputMessage(string message)
        {
            string file;
            if (TryGetArgument(OutputArgument.TextLogFile, out file))
            {
                File.AppendAllText(file, message + Environment.NewLine);
            }
            
        }
        #endregion
    }
}
